set an index of dataset in r